-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: transaction body core type now includes the auxiliaryDataHash …
…and networkId fields BREAKING CHANGE: - auxiliaryDataHash is now included in the TxBody core type. - networkId is now included in the TxBody core type. - auxiliaryData no longer contains the optional hash field. - auxiliaryData no longer contains the optional body field.
- Loading branch information
1 parent
694e04b
commit 8b92b01
Showing
23 changed files
with
327 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Metadatum, computeAuxiliaryDataHash } from '../../../src/Cardano'; | ||
|
||
describe('Cardano/types/AuxiliaryData', () => { | ||
describe('computeAuxiliaryDataHash', () => { | ||
it('can compute the correct auxiliary data hash', () => { | ||
const auxiliaryData = { | ||
blob: new Map<bigint, Metadatum>([ | ||
[1n, 1234n], | ||
[2n, 'str'], | ||
[3n, [1234n, 'str']], | ||
[4n, new Uint8Array(Buffer.from('bytes'))], | ||
[ | ||
5n, | ||
new Map<Metadatum, Metadatum>([ | ||
['strkey', 123n], | ||
[['listkey'], 'strvalue'] | ||
]) | ||
], | ||
[6n, -7n] | ||
]) | ||
}; | ||
|
||
expect(computeAuxiliaryDataHash(auxiliaryData)).toEqual( | ||
'2ceb364d93225b4a0f004a0975a13eb50c3cc6348474b4fe9121f8dc72ca0cfa' | ||
); | ||
}); | ||
|
||
it('returns undefined when given an undefined auxiliary data', () => { | ||
const auxiliaryData = undefined; | ||
|
||
expect(() => computeAuxiliaryDataHash(auxiliaryData)).not.toThrow(); | ||
expect(computeAuxiliaryDataHash(auxiliaryData)).toEqual(undefined); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.