Unverified Commit c5d28f0b authored by Osoro Bironga's avatar Osoro Bironga Committed by GitHub

accounts: abi/bid/backends; cleaned doc errors, camelCase refactors and...

accounts: abi/bid/backends; cleaned doc errors, camelCase refactors and anonymous variable assignments (#21514)
Co-authored-by: 's avatarOsoro Bironga <osoro@doctaroo.com>
parent de971cc8
This diff is collapsed.
...@@ -129,8 +129,8 @@ func TestNewSimulatedBackend(t *testing.T) { ...@@ -129,8 +129,8 @@ func TestNewSimulatedBackend(t *testing.T) {
t.Errorf("expected sim blockchain config to equal params.AllEthashProtocolChanges, got %v", sim.config) t.Errorf("expected sim blockchain config to equal params.AllEthashProtocolChanges, got %v", sim.config)
} }
statedb, _ := sim.blockchain.State() stateDB, _ := sim.blockchain.State()
bal := statedb.GetBalance(testAddr) bal := stateDB.GetBalance(testAddr)
if bal.Cmp(expectedBal) != 0 { if bal.Cmp(expectedBal) != 0 {
t.Errorf("expected balance for test address not received. expected: %v actual: %v", expectedBal, bal) t.Errorf("expected balance for test address not received. expected: %v actual: %v", expectedBal, bal)
} }
...@@ -521,7 +521,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) { ...@@ -521,7 +521,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) {
sim := NewSimulatedBackend(core.GenesisAlloc{addr: {Balance: big.NewInt(params.Ether*2 + 2e17)}}, 10000000) sim := NewSimulatedBackend(core.GenesisAlloc{addr: {Balance: big.NewInt(params.Ether*2 + 2e17)}}, 10000000)
defer sim.Close() defer sim.Close()
receipant := common.HexToAddress("deadbeef") recipient := common.HexToAddress("deadbeef")
var cases = []struct { var cases = []struct {
name string name string
message ethereum.CallMsg message ethereum.CallMsg
...@@ -530,7 +530,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) { ...@@ -530,7 +530,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) {
}{ }{
{"EstimateWithoutPrice", ethereum.CallMsg{ {"EstimateWithoutPrice", ethereum.CallMsg{
From: addr, From: addr,
To: &receipant, To: &recipient,
Gas: 0, Gas: 0,
GasPrice: big.NewInt(0), GasPrice: big.NewInt(0),
Value: big.NewInt(1000), Value: big.NewInt(1000),
...@@ -539,7 +539,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) { ...@@ -539,7 +539,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) {
{"EstimateWithPrice", ethereum.CallMsg{ {"EstimateWithPrice", ethereum.CallMsg{
From: addr, From: addr,
To: &receipant, To: &recipient,
Gas: 0, Gas: 0,
GasPrice: big.NewInt(1000), GasPrice: big.NewInt(1000),
Value: big.NewInt(1000), Value: big.NewInt(1000),
...@@ -548,7 +548,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) { ...@@ -548,7 +548,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) {
{"EstimateWithVeryHighPrice", ethereum.CallMsg{ {"EstimateWithVeryHighPrice", ethereum.CallMsg{
From: addr, From: addr,
To: &receipant, To: &recipient,
Gas: 0, Gas: 0,
GasPrice: big.NewInt(1e14), // gascost = 2.1ether GasPrice: big.NewInt(1e14), // gascost = 2.1ether
Value: big.NewInt(1e17), // the remaining balance for fee is 2.1ether Value: big.NewInt(1e17), // the remaining balance for fee is 2.1ether
...@@ -557,7 +557,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) { ...@@ -557,7 +557,7 @@ func TestSimulatedBackend_EstimateGasWithPrice(t *testing.T) {
{"EstimateWithSuperhighPrice", ethereum.CallMsg{ {"EstimateWithSuperhighPrice", ethereum.CallMsg{
From: addr, From: addr,
To: &receipant, To: &recipient,
Gas: 0, Gas: 0,
GasPrice: big.NewInt(2e14), // gascost = 4.2ether GasPrice: big.NewInt(2e14), // gascost = 4.2ether
Value: big.NewInt(1000), Value: big.NewInt(1000),
...@@ -1086,12 +1086,12 @@ func TestSimulatedBackend_CallContractRevert(t *testing.T) { ...@@ -1086,12 +1086,12 @@ func TestSimulatedBackend_CallContractRevert(t *testing.T) {
t.Errorf("result from %v was not nil: %v", key, res) t.Errorf("result from %v was not nil: %v", key, res)
} }
if val != nil { if val != nil {
rerr, ok := err.(*revertError) rErr, ok := err.(*revertError)
if !ok { if !ok {
t.Errorf("expect revert error") t.Errorf("expect revert error")
} }
if rerr.Error() != "execution reverted: "+val.(string) { if rErr.Error() != "execution reverted: "+val.(string) {
t.Errorf("error was malformed: got %v want %v", rerr.Error(), val) t.Errorf("error was malformed: got %v want %v", rErr.Error(), val)
} }
} else { } else {
// revert(0x0,0x0) // revert(0x0,0x0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment