Skip to content

Commit

Permalink
dev: rename TransferAccountRequest param (#65)
Browse files Browse the repository at this point in the history
* rename TransferAccountRequest param from to to address

* fmt constants.go
  • Loading branch information
peaceandwhisky authored Nov 1, 2024
1 parent 42e68cf commit abd1faa
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 197 deletions.
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ Requests
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| base | [AccountOperationRequest](#api-v1-AccountOperationRequest) | | |
| to | [string](#string) | | |
| address | [string](#string) | | |



Expand Down
379 changes: 190 additions & 189 deletions src/go/pb/api/v1/transferable_account.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/go/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (s *server) TransferAccount(ctx context.Context, req *pb.TransferAccountReq
return nil, err
}

tx, err := s.taStoreContractBind.TransferAccount(s.auth, *sig, req.Base.AccountId, common.HexToAddress(req.To))
tx, err := s.taStoreContractBind.TransferAccount(s.auth, *sig, req.Base.AccountId, common.HexToAddress(req.Address))
if err != nil {
log.Printf("err: %v", err)
return nil, err
Expand Down
4 changes: 3 additions & 1 deletion src/go/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ func TestIsApproved(t *testing.T) {
}
log.Printf("tx: %v", tx)

time.Sleep(2 * time.Second)

// Test cases
testCases := []struct {
name string
Expand Down Expand Up @@ -227,7 +229,7 @@ func TestTransferAccount(t *testing.T) {
AccountId: tc.accountId,
Proof: sig,
},
To: tc.to,
Address: tc.to,
}
resp, err := s.TransferAccount(context.Background(), req)

Expand Down
2 changes: 1 addition & 1 deletion src/proto/api/v1/transferable_account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ message CreateAccountRequest {

message TransferAccountRequest {
AccountOperationRequest base = 1;
string to = 2;
string address = 2;
}

message DeleteAccountRequest {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestTransferAccountE2E(t *testing.T) {
AccountId: accountId,
Proof: transferSig,
},
To: tc.to,
Address: tc.to,
}
_, resp, err := testutil.TransferAccount(request)
if tc.expectValid && err != nil {
Expand Down Expand Up @@ -361,7 +361,7 @@ func TestApproveAddressE2E(t *testing.T) {
AccountId: accountId,
Proof: transferSig,
},
To: tc.to.PublicKey.X.String(),
Address: tc.to.PublicKey.X.String(),
}
_, resp, err = testutil.TransferAccount(transferRequest)
if err != nil {
Expand Down Expand Up @@ -447,7 +447,7 @@ func TestRevokeApprovalE2E(t *testing.T) {
AccountId: accountId,
Proof: transferSig,
},
To: tc.to.PublicKey.X.String(),
Address: tc.to.PublicKey.X.String(),
}
_, resp, err = testutil.TransferAccount(transferRequest)
assert.Error(t, err)
Expand Down
2 changes: 1 addition & 1 deletion test/utils/contants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package testutil
const (
TAStoreContractPath = "TransferableAccountStore.sol/TransferableAccountStore.json"
FundedAddress = "0xBE69d72ca5f88aCba033a063dF5DBe43a4148De0"
HostURL = "http://localhost:8080"
HostURL = "http://localhost:8080"
)

0 comments on commit abd1faa

Please sign in to comment.