-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
failure in elementsIsSuperset({x, y, z}, {z}) #2588
Comments
@frazarshad writes: the issue is in the In cases where we have a set of invitations with duplicate descriptions, the function fails to mark it as a subset. we can verify by adding this test to test('test', t => {
const r1 = Remotable('Alleged: fooo');
const r0 = Remotable('Alleged: fooo');
const r2 = Remotable('Alleged: fooo');
const mainList = harden([
{
instance: r0,
description: 'fraz',
},
{
instance: r2,
description: 'fraz',
},
{
instance: r1,
description: 'alan',
},
]);
const withdraw = harden([mainList[2]]);
t.true(elementsIsSuperset(mainList, withdraw));
}); Longer explanationthis code is triggered through the purse's withdraw function when it tries to verify whether the item we are withdrawing is a subset of the items in the purse. the [
[elem1, 1n, 0n],
[elem2, 0n, 1n],
...
] in case the elements are invitations, which is a list of object with strings and remotables, it compares them by assigning tag numbers to the remotables. The problem arises when we pass invitations having the same description. while (j < length && rankCompare(value, elements[j]) === 0) {
{
instance: Object [Alleged: InstanceHandle] {},
installation: Object [Alleged: BundleIDInstallation] {},
handle: Object [Alleged: InvitationHandle] {},
description: 'oracle invitation'
}
{
instance: Object [Alleged: InstanceHandle] {},
installation: Object [Alleged: BundleIDInstallation] {},
handle: Object [Alleged: InvitationHandle] {},
description: 'oracle invitation'
} It will consider them equal, thus it will move to this line const resorted = sortByRank(similarRun, fullCompare); which performs a |
@gibson042 writes:
I'm inclined to assign this to him on that basis, but I'm not quite sure that I should. @gibson042 please assign yourself, unless there's some reason not to. cc @aj-agoric |
Describe the bug
An ERTP withdraw of
{z}
from a purse with a balance of{x, y, z}
failed.I'm abbreviating
makeCopySet(...items)
using traditional{...items}
set notation.Investigation led to a failure in
elementsIsSuperset({x, y, z}, {z})
.Steps to reproduce
Expected behavior
elementsIsSuperset({x, y, z}, {z})
always returns true for keysx
,y
, andz
.Platform environment
The original environment was a ci log of an a3p test.
It reproduces in 4406f5d
Additional context
some diagnosis to follow
The text was updated successfully, but these errors were encountered: