Taquito v17.3.0
A change in Licensing:
Taquito has moved from MIT
to Apache 2.0
.
Potential Breaking Changes:
- Previously, an
OrToken
'sEncodeObject
method would accept an object with multiple fields. It now only accepts an object with a single field. - The
generateSchema
method in anOrToken
with nestedOrToken
s (as well asExtractSchema
) would generate a schema object that was misleading and did not match whatExecute
created orEncodeObject
accepted. This is now fixed and the behavior is consistent across all methods. OrToken.Execute()
used to throwOrTokenDecodingError
in case of failure, but now will throwOrValidationError
Summary
New Features
@taquito/michelson-encoder
- TheOrToken
'sEncodeObject
method now only accepts an object with a single field #2544
Bug Fixes
@taquito/michelson-encoder
- A nestedPairToken
with a mix of fields withannots
and fields withoutannots
could generate the wrong javascript object withExecute
#2540@taquito/michelson-encoder
- thegenerateSchema
method in a nestedOrToken
now generates a schema that is consistent withExecute
andEncodeObject
#2543
const schema = {
prim: 'pair',
args: [
{
prim: 'pair',
args: [
{
prim: 'pair',
args: [{ prim: 'int' }, { prim: 'int' }],
annots: ['%A3'],
},
{ prim: 'int' },
],
},
{ prim: 'bool' },
],
};
const michelineJson = {
prim: 'Pair',
args: [
{
prim: 'Pair',
args: [{ prim: 'Pair', args: [{ int: '11' }, { int: '22' }] }, { int: '33' }],
},
{ prim: 'True' },
],
};
const javaScriptObject = new Schema(schema).Execute(michelineJson);
Previously, this javaScriptObject
would be equal to:
{
2: true,
A3: {
0: 11,
1: 22,
},
}
But now it returns:
{
1: 33,
2: true,
A3: {
0: 11,
1: 22,
},
}
Internals
integration-tests
config improvement #2163- update RPC urls to align with the updated infrastructure PR#2576 #2633
@taquito/michelson-encoder
- Validate that an OrToken
's EncodeObject
method only accepts an object with a single field
Previously, an OrToken
's EncodeObject
method would accept an object with multiple fields. It now only accepts an object with a single field.
const token = createToken({
prim: 'or',
args: [{ prim: 'int' }, { prim: 'string' }], annots: []
}, 0) as OrToken;
const javascriptObject = token.EncodeObject({ '0': 10, '1': '10' }));
Previously, this would return work and the result was the same as token.EncodeObject({ '0': 10, '1': '10' }))
. Now, this throws an error.
@taquito/michelson-encoder
- For an OrToken
with nested OrToken
s, generateSchema
behaved inconsistently with Execute
and EncodeObject
Previously, generateSchema
would generate a schema object that was misleading and did not match what Execute
created or EncodeObject
accepted. This is now fixed and the behavior is consistent across all methods.
const token = createToken(
{
prim: 'or',
args: [
{
prim: 'bytes',
},
{
prim: 'or',
annots: ['A'],
args: [
{
prim: 'or',
args: [{ prim: 'int' }, { prim: 'nat' }],
},
{ prim: 'bool' },
],
},
],
},
0
) as OrToken;
const schema = token.generateSchema();
Previously, schema
would be equal to:
{
__michelsonType: "or",
schema: {
"0": { __michelsonType: "bytes", schema: "bytes" },
"A": {
__michelsonType: "or",
schema: {
"1": { __michelsonType: "int", schema: "int" },
"2": { __michelsonType: "nat", schema: "nat" },
"3": { __michelsonType: "bool", schema: "bool" }
}
}
}
}
Which was inconsistent with what Execute
created and what EncodeObject
accepted.
Now it is:
{
__michelsonType: 'or',
schema: {
0: { __michelsonType: 'bytes', schema: 'bytes' },
1: { __michelsonType: 'int', schema: 'int' },
2: { __michelsonType: 'nat', schema: 'nat' },
3: { __michelsonType: 'bool', schema: 'bool' },
},
}