Skip to content

Commit

Permalink
updated asset transfer component method
Browse files Browse the repository at this point in the history
  • Loading branch information
poocart committed Feb 20, 2024
1 parent c1f7fb4 commit 58be07b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.7.3] - 2024-02-20

### Added Changes
- Fixed `<EtherspotTokenTransferTransaction />` component's used transfer method

## [0.7.2] - 2024-02-07

### Added Changes
Expand Down
6 changes: 3 additions & 3 deletions __tests__/components/EtherspotContractTransaction.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ describe('EtherspotContractTransaction', () => {
<EtherspotBatches>
<EtherspotBatch>
<EtherspotContractTransaction
abi={['function transfer(address, uint)']}
abi={['function transferFrom(address, uint)']}
contractAddress={'0x'}
methodName={'transferFrom'}
methodName={'transfer'}
params={[0]}
/>
</EtherspotBatch>
Expand All @@ -59,7 +59,7 @@ describe('EtherspotContractTransaction', () => {
))
.toThrow(
'Failed to build transaction data, please check data/method formatting: no matching function'
+ ' (argument="name", value="transferFrom", code=INVALID_ARGUMENT, version=abi/5.7.0)'
+ ' (argument="name", value="transfer", code=INVALID_ARGUMENT, version=abi/5.7.0)'
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('EtherspotTokenTransferTransaction', () => {
await waitFor(() => expect(result.current.batches[0].batches[0].transactions[0]).not.toBe(undefined));

expect(result.current.batches[0].batches[0].transactions[0].to).toBe('0xe3818504c1b32bf1557b16c238b2e01fd3149c17');
expect(result.current.batches[0].batches[0].transactions[0].data).toBe('0x23b872dd0000000000000000000000007f30b1960d5556929b03a0339814fe903c55a3470000000000000000000000007f30b1960d5556929b03a0339814fe903c55a347000000000000000000000000000000000000000000000006aaf7c8516d0c0000');
expect(result.current.batches[0].batches[0].transactions[0].data).toBe('0xa9059cbb0000000000000000000000007f30b1960d5556929b03a0339814fe903c55a347000000000000000000000000000000000000000000000006aaf7c8516d0c0000');
expect(result.current.batches[0].batches[0].transactions[0].value).toBe(undefined);
});
})
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@etherspot/transaction-kit",
"description": "React Etherspot Transaction Kit",
"version": "0.7.2",
"version": "0.7.3",
"main": "dist/cjs/index.js",
"scripts": {
"rollup:build": "NODE_OPTIONS=--max-old-space-size=8192 rollup -c",
Expand Down
6 changes: 3 additions & 3 deletions src/components/EtherspotTokenTransferTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ const EtherspotTokenTransferTransaction = ({
<EtherspotContractTransaction
id={transactionId ?? componentId}
contractAddress={tokenAddress}
methodName={'transferFrom'}
abi={['function transferFrom(address from, address to, uint256 value)']}
params={[senderAddress ?? '', receiverAddress, valueBN]}
methodName={'transfer'}
abi={['function transfer(address to, uint256 value)']}
params={[receiverAddress, valueBN]}
>
{children}
</EtherspotContractTransaction>
Expand Down

0 comments on commit 58be07b

Please sign in to comment.