Skip to content

Commit

Permalink
Fix gram tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksej-paschenko committed May 1, 2024
1 parent aeb5cd5 commit db8976b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
40 changes: 21 additions & 19 deletions abi/generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,27 @@ func TestMessageDecoder(t *testing.T) {
interfaces []ContractInterface
wantValidate func(t *testing.T, value any)
}{
{
name: "gram miner - submit proof of work",
interfaces: []ContractInterface{GramMiner},
wantOpName: "GramSubmitProofOfWork",
boc: "te6ccgEBAQEAewAA8k1pbmUAZh5n6Ko92S+6JcXv0vZh3JgmUoAzO2R8CeNp7hvCAYZUe9AHyiw3HOIN5fq3UWUTxJ2NzkQQ8n/18ag79sePGkYAAACknATyivxe2NapVEVFPsjSyiw3HOIN5fq3UWUTxJ2NzkQQ8n/18ag79sePGkYAAAA=",
wantValidate: func(t *testing.T, value any) {
seed := big.Int{}
seed.SetString("218803489964525407889229111495606847698", 10)
body := GramSubmitProofOfWorkMsgBody{
Flags: 0,
Expire: 1713268712,
Whom: mustToBits256("aa3dd92fba25c5efd2f661dc98265280333b647c09e369ee1bc20186547bd007"),
Rdata1: mustToBits256("ca2c371ce20de5fab7516513c49d8dce4410f27ff5f1a83bf6c78f1a46000000"),
Rseed: tlb.Uint128(seed),
Rdata2: mustToBits256("ca2c371ce20de5fab7516513c49d8dce4410f27ff5f1a83bf6c78f1a46000000"),
}
if !reflect.DeepEqual(value, body) {
t.Fatalf("got: %v, want: %v", value, body)
}
},
},
{
name: "jetton burn notification",
boc: "te6ccgEBAQEASAAAi3vdl952mKNkA9fVjzGM4ygA2ZpktQsYby0n9cV5VWOFINBjScIU2HdondFsK3lDpEB64AEuSPMwX2JvQ+QTUtfXxYKTyMA=",
Expand Down Expand Up @@ -1075,25 +1096,6 @@ func TestDecodeExternalIn(t *testing.T) {
wantOpName string
wantValue func() any
}{
{
name: "gram miner - submit proof of work",
interfaces: []ContractInterface{GramMiner},
wantOpName: "GramSubmitProofOfWork",
boc: "te6ccgEBAQEAewAA8k1pbmUAZh5n6Ko92S+6JcXv0vZh3JgmUoAzO2R8CeNp7hvCAYZUe9AHyiw3HOIN5fq3UWUTxJ2NzkQQ8n/18ag79sePGkYAAACknATyivxe2NapVEVFPsjSyiw3HOIN5fq3UWUTxJ2NzkQQ8n/18ag79sePGkYAAAA=",
wantValue: func() any {
seed := big.Int{}
seed.SetString("218803489964525407889229111495606847698", 10)
body := GramSubmitProofOfWorkMsgBody{
Flags: 0,
Expire: 1713268712,
Whom: mustToBits256("aa3dd92fba25c5efd2f661dc98265280333b647c09e369ee1bc20186547bd007"),
Rdata1: mustToBits256("ca2c371ce20de5fab7516513c49d8dce4410f27ff5f1a83bf6c78f1a46000000"),
Rseed: tlb.Uint128(seed),
Rdata2: mustToBits256("ca2c371ce20de5fab7516513c49d8dce4410f27ff5f1a83bf6c78f1a46000000"),
}
return body
},
},
{
name: "highload wallet v3 - jetton transfer",
interfaces: []ContractInterface{WalletHighloadV3R1},
Expand Down
2 changes: 1 addition & 1 deletion abi/schemas/gram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
</output>
</get_method>
<internal name="gram_submit_proof_of_work">
payload#4d696e65 flags:uint8 expire:uint32 whom:bits256 rdata1:bits256 rseed:uint128 rdata2:bits256 = ExternalMsgBody;
payload#4d696e65 flags:uint8 expire:uint32 whom:bits256 rdata1:bits256 rseed:uint128 rdata2:bits256 = InternalMsgBody;
</internal>
</abi>

0 comments on commit db8976b

Please sign in to comment.