Closed stanleyjones closed 1 year ago
Are we testing somewhere that the CBOR encoding/decoding works?
They're not great but there are some in the /src/message
directory. The tests in this PR are focused on the payloads for this namespace.
@hansl We do use maps everywhere internally. I feel like one of the high-level design goals of ManyJs is to allow developers to do this...
network.tokens.create({
summary: {
name: "MyToken",
symbol: "MTK",
precision: 9,
},
owner: address,
distribution: new Map([[address, BigInt(inputs.amount)]]),
});
...instead of this...
network.tokens.create(new Map([
[0, new Map([
[0, "MyToken"],
[1, "MTK"],
[2, 9],
]),
[1, address],
[2, new Map([[address, BigInt(inputs.amount)]])],
]);
Is that reasonable?
Okay, comments addressed. The PR is already approved so I'll merge assuming tests pass.
Description
tokens.info
tokens.create
tokens.update
Related Issue
Fixes liftedinit/roadmap#21
Testing
Added unit tests for the above functions and fixed a bug where automatically adding a
nonce
wouldn't work outside of browsers.Breaking Changes (if applicable)
None. Everything is under a new namespace.