Skip to content

Commit

Permalink
Merge branch 'dev' into __release-pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Sep 26, 2024
2 parents 0363e9e + acfde56 commit 10592b8
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .yarn/versions/9c11183a.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
releases:
"@fluent-wallet/cfx_call": patch

declined:
- helios
- helios-background
68 changes: 68 additions & 0 deletions packages/background/src/index.integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2891,5 +2891,73 @@ describe('integration test', () => {
expect(res.result.startsWith('0x')).toBe(true)
})
})

describe('cfx_call', async () => {
test('cfx_call', async () => {
const {token1} = await deployCRC20()
await request({
method: 'wallet_importMnemonic',
params: {mnemonic: MNEMONIC, password},
})
expect(
(
await request({
method: 'cfx_call',
params: [
{
to: token1.contractAddress,
data: '0x06fdde03',
},
],
})
).result.startsWith('0x'),
).toBe(true)
expect(
(
await request({
method: 'cfx_call',
params: [
{
to: token1.contractAddress,
data: '0x06fdde03',
maxPriorityFeePerGas: '0x4a817c800',
},
],
})
).result.startsWith('0x'),
).toBe(true)
expect(
(
await request({
method: 'cfx_call',
params: [
{
to: token1.contractAddress,
data: '0x06fdde03',
maxPriorityFeePerGas: '0x4a817c800',
maxFeePerGas: '0x4a817c800',
},
],
})
).result.startsWith('0x'),
).toBe(true)
expect(
(
await request({
method: 'cfx_call',
params: [
{
to: token1.contractAddress,
data: '0x06fdde03',
maxPriorityFeePerGas: '0x4a817c800',
maxFeePerGas: '0x4a817c800',
type: '0x2',
},
],
})
).result.startsWith('0x'),
).toBe(true)
})
})
})
})
26 changes: 26 additions & 0 deletions packages/rpcs/cfx_call/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import {
base32ContractAddress,
Uint,
Bytes,
catn,
Hash32,
base32Address,
} from '@fluent-wallet/spec'

export const NAME = 'cfx_call'
Expand All @@ -32,6 +35,29 @@ export const schemas = {
['value', {optional: true}, Uint],
['data', {optional: true}, Bytes],
['nonce', {optional: true}, Uint],
['type', {optional: true}, Uint],
['maxPriorityFeePerGas', {optional: true}, Uint],
['maxFeePerGas', {optional: true}, Uint],
[
'accessList',
{optional: true},
[
catn,
[
'AccessListEntry',
[
map,
{closed: true},
['address', {optional: true}, base32Address],
[
'storageKeys',
{optional: true},
[catn, ['32BtyeHexValue', Hash32]],
],
],
],
],
],
],
epochRef,
],
Expand Down

0 comments on commit 10592b8

Please sign in to comment.