Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tron committed Apr 11, 2024
1 parent 3747d32 commit 53f462c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion abi/contracts_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func GetContractError(interfaces []ContractInterface, code int32) *string {
errors := defaultExitCodes
for _, i := range interfaces {
e, ok := contractErrors[i]
if !ok {
if ok {
errors = e
break
}
Expand Down
15 changes: 14 additions & 1 deletion abi/generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ func TestMessageDecoder(t *testing.T) {
boc string
wantOpName MsgOpName
wantValue any
interfaces []ContractInterface
wantValidate func(t *testing.T, value any)
}{
{
Expand Down Expand Up @@ -992,6 +993,18 @@ func TestMessageDecoder(t *testing.T) {
}
},
},
{
name: "to call burn",
boc: "b5ee9c72010102010068000163235caf5200000000000000008009c6cc9f5dd029f7b6d83966dae5758a5a2bc30d823d9acc9fc367e34f9fb003a805f5e101010062595f07bc00000000000000003989680800e5944d41c7c4db84cec5670a26da5cb9afe0adfbcaa0699923fe88638b558d0c",
wantOpName: JettonCallToMsgOp,
wantValidate: func(t *testing.T, value any) {
call := value.(JettonCallToMsgBody)
if call.MasterMsg.SumType != "Burn" {
t.Error("invalid master message type")
}
},
interfaces: []ContractInterface{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand All @@ -1003,7 +1016,7 @@ func TestMessageDecoder(t *testing.T) {
}
c = cells[0]
}
_, opName, value, err := InternalMessageDecoder(c, nil)
_, opName, value, err := InternalMessageDecoder(c, tt.interfaces)
if err != nil {
t.Fatalf("MessageDecoder() error: %v", err)
}
Expand Down

0 comments on commit 53f462c

Please sign in to comment.