Skip to content

Commit

Permalink
Remove scientific number test - not supporting at present
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
  • Loading branch information
matthew1001 committed Sep 3, 2024
1 parent 16d9f21 commit bad89ec
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions internal/ethereum/deploy_contract_prepare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,37 +96,6 @@ const samplePrepareDeployTXLargeInputParams = `{
"params": [ 10000000000000000000000001, "some-text" ]
}`

const samplePrepareDeployTXScientificNotation = `{
"ffcapi": {
"version": "v1.0.0",
"id": "904F177C-C790-4B01-BDF4-F2B4E52E607E",
"type": "DeployContract"
},
"from": "0xb480F96c0a3d6E9e9a263e4665a39bFa6c4d01E8",
"to": "0xe1a078b9e2b145d0a7387f09277c6ae1d9470771",
"gas": 1000000,
"nonce": "111",
"value": "12345678901234567890123456789",
"contract": "0xdeadbeef",
"definition": [{
"inputs": [
{
"internalType":" uint256",
"name": "x",
"type": "uint256"
},
{
"internalType":" string",
"name": "y",
"type": "string"
}
],
"outputs":[],
"type":"constructor"
}],
"params": [ 1.0000000000000000000000001e+25, "some-text" ]
}`

func TestDeployContractPrepareOkNoEstimate(t *testing.T) {

ctx, c, _, done := newTestConnector(t)
Expand Down Expand Up @@ -167,24 +136,6 @@ func TestDeployContractPrepareOkLargeInputParam(t *testing.T) {
assert.True(t, strings.Contains(res.TransactionData, "736f6d652d74657874"))
}

func TestDeployContractPrepareOkScientificNotationParam(t *testing.T) {

ctx, c, _, done := newTestConnector(t)
defer done()

var req ffcapi.ContractDeployPrepareRequest
err := json.Unmarshal([]byte(samplePrepareDeployTXScientificNotation), &req)
assert.NoError(t, err)
res, reason, err := c.DeployContractPrepare(ctx, &req)
assert.NoError(t, err)
assert.Empty(t, reason)
assert.Equal(t, int64(1000000), res.Gas.Int64())
// Basic check that our input param 1.0000000000000000000000001e+25 is in the TX data
assert.True(t, strings.Contains(res.TransactionData, "84595161401484a000001"))
// Basic check that our input param "some-text" is in the TX data
assert.True(t, strings.Contains(res.TransactionData, "736f6d652d74657874"))
}

func TestDeployContractPrepareWithEstimateRevert(t *testing.T) {

ctx, c, mRPC, done := newTestConnector(t)
Expand Down

0 comments on commit bad89ec

Please sign in to comment.