diff options
author | Aaron Buchwald <[email protected]> | 2020-09-23 00:38:51 -0400 |
---|---|---|
committer | Aaron Buchwald <[email protected]> | 2020-09-23 00:38:51 -0400 |
commit | 332dc311e9a21f21f141cfb262c7c23f5ea61ecb (patch) | |
tree | 2b7847f20c8b4be18776d828ccc9b40e8d963f1d /plugin/evm/tx.go | |
parent | a725a6a16c53f508681484e36729ebe65a5b33b1 (diff) |
Change name of EVMInputs inner sort struct
Diffstat (limited to 'plugin/evm/tx.go')
-rw-r--r-- | plugin/evm/tx.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugin/evm/tx.go b/plugin/evm/tx.go index fd52222..db49980 100644 --- a/plugin/evm/tx.go +++ b/plugin/evm/tx.go @@ -119,30 +119,30 @@ func (tx *Tx) Sign(c codec.Codec, signers [][]*crypto.PrivateKeySECP256K1R) erro return nil } -// innerSortInputs implements sort.Interface for EVMInput -type innerSortInputs struct { +// innerSortInputsAndSigners implements sort.Interface for EVMInput +type innerSortInputsAndSigners struct { inputs []EVMInput signers [][]*crypto.PrivateKeySECP256K1R } -func (ins *innerSortInputs) Less(i, j int) bool { +func (ins *innerSortInputsAndSigners) Less(i, j int) bool { return bytes.Compare(ins.inputs[i].Address.Bytes(), ins.inputs[j].Address.Bytes()) < 0 } -func (ins *innerSortInputs) Len() int { return len(ins.inputs) } +func (ins *innerSortInputsAndSigners) Len() int { return len(ins.inputs) } -func (ins *innerSortInputs) Swap(i, j int) { +func (ins *innerSortInputsAndSigners) Swap(i, j int) { ins.inputs[j], ins.inputs[i] = ins.inputs[i], ins.inputs[j] ins.signers[j], ins.signers[i] = ins.signers[i], ins.signers[j] } // SortEVMInputsAndSigners sorts the list of EVMInputs based solely on the address of the input func SortEVMInputsAndSigners(inputs []EVMInput, signers [][]*crypto.PrivateKeySECP256K1R) { - sort.Sort(&innerSortInputs{inputs: inputs, signers: signers}) + sort.Sort(&innerSortInputsAndSigners{inputs: inputs, signers: signers}) } // IsSortedAndUniqueEVMInputs returns true if the EVM Inputs are sorted and unique // based on the account addresses func IsSortedAndUniqueEVMInputs(inputs []EVMInput) bool { - return utils.IsSortedAndUnique(&innerSortInputs{inputs: inputs}) + return utils.IsSortedAndUnique(&innerSortInputsAndSigners{inputs: inputs}) } |