Skip to content

Commit

Permalink
add signature arguement when creat Order(fix #21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred0327 committed Oct 11, 2023
1 parent f14bcf9 commit 32634d7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions binding_tests/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ func TestSignOrderMatching(t *testing.T) {
true,
2,
5,
nil,
)
taker, err = sdk.CreateSignedOrder(
zklink_signer,
Expand All @@ -165,6 +166,7 @@ func TestSignOrderMatching(t *testing.T) {
false,
2,
5,
nil,
)
maker, err = sdk.CreateSignedOrder(
zklink_signer,
Expand Down
3 changes: 2 additions & 1 deletion bindings/sdk/src/ffi.udl
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ interface Order {
BigUint price,
boolean is_sell,
u8 fee_ratio1,
u8 fee_ratio2
u8 fee_ratio2,
ZkLinkSignature ?signature
);
ZkLinkSignature signature();
sequence<u8> get_bytes();
Expand Down
2 changes: 2 additions & 0 deletions examples/Golang/5_order_matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func HighLevelOrderMatching() {
true,
2,
5,
nil,
)
taker, err = sdk.CreateSignedOrder(
zklinkSigner,
Expand All @@ -54,6 +55,7 @@ func HighLevelOrderMatching() {
false,
2,
5,
nil,
)
maker, err = sdk.CreateSignedOrder(
zklinkSigner,
Expand Down
3 changes: 2 additions & 1 deletion types/src/tx_type/order_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ impl Order {
is_sell: bool,
fee_ratio1: u8,
fee_ratio2: u8,
signature: Option<ZkLinkSignature>,
) -> Self {
Self {
account_id,
Expand All @@ -84,7 +85,7 @@ impl Order {
is_sell: u8::from(is_sell),
fee_ratio1,
fee_ratio2,
signature: ZkLinkSignature::default(),
signature: signature.unwrap_or_default(),
}
}

Expand Down

0 comments on commit 32634d7

Please sign in to comment.