-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: numbers parsing; add start of test
- Loading branch information
1 parent
55e704b
commit 2ea4a64
Showing
3 changed files
with
92 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
const xdr = SorobanClient.xdr; | ||
const ScInt = SorobanClient.ScInt; // shorthand | ||
const [scValToNative, nativeToScVal] = [ | ||
SorobanClient.scValToNative, | ||
SorobanClient.nativeToScVal | ||
]; | ||
|
||
describe('parsing and building ScVals', function () { | ||
|
||
|
||
it('Can parse entries', function () { | ||
CUSTOM_TYPES_XDR.forEach((entry, i) => { | ||
console.log(entry) | ||
console.log(xdr.ScSpecEntry.fromXDR(entry, 'base64')); | ||
}); | ||
|
||
}); | ||
|
||
}); | ||
|
||
|
||
function custom_types_spec() { | ||
return SorobanClient.ContractSpec(xdr.Sp) | ||
} | ||
|
||
const CUSTOM_TYPES_XDR = ["AAAAAQAAAC9UaGlzIGlzIGZyb20gdGhlIHJ1c3QgZG9jIGFib3ZlIHRoZSBzdHJ1Y3QgVGVzdAAAAAAAAAAABFRlc3QAAAADAAAAAAAAAAFhAAAAAAAABAAAAAAAAAABYgAAAAAAAAEAAAAAAAAAAWMAAAAAAAAR", | ||
"AAAAAgAAAAAAAAAAAAAAClNpbXBsZUVudW0AAAAAAAMAAAAAAAAAAAAAAAVGaXJzdAAAAAAAAAAAAAAAAAAABlNlY29uZAAAAAAAAAAAAAAAAAA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