Skip to content

Commit

Permalink
Adjusted getBalance endpoint call opt
Browse files Browse the repository at this point in the history
  • Loading branch information
glottologist committed Oct 30, 2023
1 parent f1a85c8 commit 690531f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
10 changes: 5 additions & 5 deletions batcher/michelson/btctz-vault-ghostnet.tz
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -543,7 +543,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1111,7 +1111,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1172,7 +1172,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1634,7 +1634,7 @@
CONTRACT %balance_response_fa2
(list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))) ;
DIG 3 ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
DIG 3 ;
CONTRACT %balance_response_fa12 nat ;
IF_NONE { PUSH bool False } { DROP ; PUSH bool True } ;
Expand Down
10 changes: 5 additions & 5 deletions batcher/michelson/eurl-vault-ghostnet.tz
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -543,7 +543,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1111,7 +1111,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1172,7 +1172,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1634,7 +1634,7 @@
CONTRACT %balance_response_fa2
(list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))) ;
DIG 3 ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
DIG 3 ;
CONTRACT %balance_response_fa12 nat ;
IF_NONE { PUSH bool False } { DROP ; PUSH bool True } ;
Expand Down
10 changes: 5 additions & 5 deletions batcher/michelson/tzbtc-vault-ghostnet.tz
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -543,7 +543,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1111,7 +1111,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1172,7 +1172,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1634,7 +1634,7 @@
CONTRACT %balance_response_fa2
(list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))) ;
DIG 3 ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
DIG 3 ;
CONTRACT %balance_response_fa12 nat ;
IF_NONE { PUSH bool False } { DROP ; PUSH bool True } ;
Expand Down
10 changes: 5 additions & 5 deletions batcher/michelson/usdt-vault-ghostnet.tz
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -543,7 +543,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1111,7 +1111,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1172,7 +1172,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1634,7 +1634,7 @@
CONTRACT %balance_response_fa2
(list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))) ;
DIG 3 ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
DIG 3 ;
CONTRACT %balance_response_fa12 nat ;
IF_NONE { PUSH bool False } { DROP ; PUSH bool True } ;
Expand Down
10 changes: 5 additions & 5 deletions batcher/michelson/usdtz-vault-ghostnet.tz
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -543,7 +543,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1111,7 +1111,7 @@
DUP 2 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1172,7 +1172,7 @@
DUP 3 ;
CONTRACT %balance_response_fa12 nat ;
SWAP ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
SWAP ;
IF_NONE
{ DROP ; PUSH nat 172 ; FAILWITH }
Expand Down Expand Up @@ -1634,7 +1634,7 @@
CONTRACT %balance_response_fa2
(list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))) ;
DIG 3 ;
CONTRACT %getbalance (pair (contract %callback nat) (address %owner)) ;
CONTRACT %getBalance (pair (contract %callback nat) (address %owner)) ;
DIG 3 ;
CONTRACT %balance_response_fa12 nat ;
IF_NONE { PUSH bool False } { DROP ; PUSH bool True } ;
Expand Down
4 changes: 2 additions & 2 deletions batcher/utils.mligo
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ let entrypoints_exist
(token_fa2_addr: address) : bool * bool * bool * bool =
let bo_fa2_opt: balance_of contract option = Tezos.get_entrypoint_opt "%balance_of" token_fa2_addr in
let cb_fa2_opt: balance_of_responses contract option = Tezos.get_entrypoint_opt "%balance_response_fa2" callback in
let bo_fa12_opt: get_balance_request contract option = Tezos.get_entrypoint_opt "%getbalance" token_fa12_addr in
let bo_fa12_opt: get_balance_request contract option = Tezos.get_entrypoint_opt "%getBalance" token_fa12_addr in
let cb_fa12_opt: nat contract option = Tezos.get_entrypoint_opt "%balance_response_fa12" callback in
(is_some bo_fa2_opt),(is_some cb_fa2_opt),(is_some bo_fa12_opt),(is_some cb_fa12_opt)

Expand Down Expand Up @@ -1103,7 +1103,7 @@ let entrypoints_exist
(callback: address)
(token_addr: address) : operation =
let cb_opt: nat contract option = Tezos.get_entrypoint_opt "%balance_response_fa12" callback in
let bo_opt = Tezos.get_entrypoint_opt "%getbalance" token_addr in
let bo_opt = Tezos.get_entrypoint_opt "%getBalance" token_addr in
match cb_opt,bo_opt with
| None, _ -> failwith unable_to_get_balance_response_fa12_entrypoint_from_vault
| _, None -> failwith unable_to_get_get_balance_entrypoint_from_fa12_token
Expand Down

0 comments on commit 690531f

Please sign in to comment.