Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null fix #308

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions abi/generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func TestGetMethods(t *testing.T) {
MaxNominatorsCount: 0x1,
MinValidatorStake: 1001000000000,
MinNominatorStake: 300000000000000,
Nominators: tlb.Any(*boc.NewCell()),
Nominators: pointer(tlb.Any(*boc.NewCell())),
WithdrawRequests: nil,
StakeAt: 0x64104f08,
SavedValidatorSetHash: tlb.Bits256{0xe2, 0x70, 0x3, 0xa2, 0xcb, 0x1a, 0xa9, 0xad, 0xd7, 0xe4, 0xc, 0xe, 0x5, 0x2e, 0x37, 0xb6, 0x61, 0xb, 0x18, 0xfc, 0xf5, 0x77, 0x8b, 0x87, 0x26, 0x28, 0x45, 0x28, 0x54, 0xbb, 0x34, 0x6c},
Expand Down Expand Up @@ -644,7 +644,7 @@ func TestGetMethods(t *testing.T) {
case GetPoolData_TfResult:
// comparing two cells don't work well with reflect.DeepEqual()
// because of the internal fields like refCursor
x.Nominators = tlb.Any(*boc.NewCell())
x.Nominators = pointer(tlb.Any(*boc.NewCell()))
got = x
case GetAssets_DedustResult:
addr := ton.AccountID{
Expand Down
4 changes: 2 additions & 2 deletions abi/get_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -2361,7 +2361,7 @@ type GetPoolData_TfResult struct {
MaxNominatorsCount uint32
MinValidatorStake int64
MinNominatorStake int64
Nominators tlb.Any
Nominators *tlb.Any
WithdrawRequests *AccountLists
StakeAt uint32
SavedValidatorSetHash tlb.Bits256
Expand Down Expand Up @@ -2411,7 +2411,7 @@ func DecodeGetPoolData_StonfiV2Result(stack tlb.VmStack) (resultType string, res
}

func DecodeGetPoolData_TfResult(stack tlb.VmStack) (resultType string, resultAny any, err error) {
if len(stack) < 17 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkCell") || (stack[10].SumType != "VmStkCell" && stack[10].SumType != "VmStkNull") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkTuple" && stack[16].SumType != "VmStkNull") {
if len(stack) < 17 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkCell" && stack[9].SumType != "VmStkNull") || (stack[10].SumType != "VmStkCell" && stack[10].SumType != "VmStkNull") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkTuple" && stack[16].SumType != "VmStkNull") {
return "", nil, fmt.Errorf("invalid stack format")
}
var result GetPoolData_TfResult
Expand Down
2 changes: 1 addition & 1 deletion abi/schemas/tonvalidators.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<int name="max_nominators_count">uint32</int>
<int name="min_validator_stake">int64</int>
<int name="min_nominator_stake">int64</int>
<cell name="nominators">any</cell>
<cell name="nominators" nullable="true">any</cell>
<cell name="withdraw_requests" nullable="true">AccountLists</cell>
<int name="stake_at">uint32</int>
<int name="saved_validator_set_hash">bits256</int>
Expand Down
Loading