-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X-chain - consolidate tx creation in unit tests #2736
Merged
Merged
Changes from 132 commits
Commits
Show all changes
156 commits
Select commit
Hold shift + click to select a range
1adc328
E fork scaffolding
abi87 f6d7382
Merge branch 'dev' into e-fork-scaffolding
abi87 3889e51
Merge branch 'dev' into e-fork-scaffolding
abi87 e725961
Merge branch 'dev' into e-fork-scaffolding
abi87 30a4343
Merge branch 'dev' into e-fork-scaffolding
abi87 add3a35
Merge branch 'dev' into e-fork-scaffolding
abi87 3d08216
Merge branch 'dev' into e-fork-scaffolding
abi87 8f35564
Merge branch 'dev' into e-fork-scaffolding
abi87 2b16538
Merge branch 'master' into e-fork-scaffolding
abi87 4751e79
Merge branch 'master' into e-fork-scaffolding
abi87 e00d7c9
drop temporary fork time
abi87 b454987
Merge branch 'master' into e-fork-scaffolding
abi87 f832034
nits
abi87 d33a6a2
Merge branch 'master' into e-fork-scaffolding
abi87 8a89505
Merge branch 'master' into e-fork-scaffolding
abi87 3daec34
cleanup
abi87 a0020b1
Merge branch 'master' into e-fork-scaffolding
abi87 f28b80b
Merge branch 'master' into e-fork-scaffolding
abi87 26fcb79
Merge branch 'master' into e-fork-scaffolding
abi87 1feae9a
refactored createAssetTx builder
abi87 39cae3c
refactored baseTx builder
abi87 199424b
Merge branch 'master' into e-fork-scaffolding
abi87 7c04d76
refactored operationTx builder
abi87 40e480a
refactored exportTx builder
abi87 03c0a9f
wip: refactoring importTx builder
abi87 cb0a693
replaced Spend with NewSpend
abi87 625817e
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 1f95de4
nits
abi87 5ea9c0b
Merge branch 'master' into e-fork-scaffolding
abi87 dcdf22c
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 2b05cf1
Merge branch 'master' into e-fork-scaffolding
abi87 9a6795b
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 9b97764
Merge branch 'master' into e-fork-scaffolding
abi87 6315ae0
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 a4b81e6
fork switch to the avm
abi87 392e935
Merge branch 'master' into e-fork-scaffolding
abi87 d3a733e
Merge branch 'master' into e-fork-scaffolding
abi87 0db8e79
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 a8d8111
repackaged x-chain wallet backends
abi87 c6fa18c
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 1d61776
minor repackaging
abi87 d975933
wip: consolidating tx building
abi87 57f5b22
wip: some more consolidation
abi87 60277cd
Merge branch 'e-fork-scaffolding' into x-chain-consolidate-tx-creation
abi87 68f5cb7
removed noFeesTestConfg from avm unit tests
abi87 10a2c74
Merge branch 'master' into x-chain_wallet_backends
abi87 9351da1
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 8e45dd9
Merge branch 'master' into x-chain_wallet_backends
abi87 8bc9160
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 8d74f21
Merge branch 'master' into x-chain_wallet_backends
abi87 929dfab
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 0be7156
Merge branch 'master' into x-chain_wallet_backends
abi87 e59213b
Merge branch 'master' into x-chain_wallet_backends
abi87 2492f5e
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 54a7f4b
Merge branch 'master' into x-chain_wallet_backends
abi87 48087b1
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 ae9e074
Merge branch 'master' into x-chain_wallet_backends
abi87 11d1ec8
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 80b4464
Merge branch 'master' into x-chain_wallet_backends
abi87 a1e71bb
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 1e9348f
Merge branch 'master' into x-chain_wallet_backends
abi87 2fd9017
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 b33d825
Merge branch 'master' into x-chain_wallet_backends
abi87 eb41fdb
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 f0b3c69
fixed merge
abi87 8420192
fixed merge
abi87 54d3440
Merge branch 'master' into x-chain_wallet_backends
abi87 1711699
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 0cd1353
Merge branch 'master' into x-chain_wallet_backends
abi87 78b6460
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 31b691a
merged
StephenButtolph 1a8490c
merged
StephenButtolph a98e9b1
merged
StephenButtolph 59a1e07
fix
StephenButtolph 40ef4fa
Merge branch 'x-chain_wallet_backends' into x-chain-consolidate-tx-cr…
abi87 5782a14
fixed merge
abi87 f2d8c8c
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 688592d
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 1e73a95
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 65f77e4
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 18e6293
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 5d69721
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 8037af7
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 1d4353d
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 bb07c56
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 892a043
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 0628635
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 f7786e8
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 0365a16
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 917fada
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 5667ace
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 c2165c2
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 7088342
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 34cf1ee
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 ebb56c1
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 a529c11
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 c7d9274
reverted UTs changes
abi87 1bd4b3a
reduced diff
abi87 9000228
nit
abi87 309a42e
consolidated tx creation in UTs
abi87 a3d31b5
Merge branch 'x-chain_repack_tx_builder' into x-chain-consolidate-tx-…
abi87 136edf5
Merge branch 'master' into x-chain_repack_tx_builder
abi87 43d3776
Merge branch 'x-chain_repack_tx_builder' into x-chain-consolidate-tx-…
abi87 c2ec02c
Merge branch 'master' into x-chain_repack_tx_builder
abi87 8dfbf73
Merge branch 'master' into x-chain_repack_tx_builder
abi87 249cd6b
Merge branch 'master' into x-chain_repack_tx_builder
abi87 3aba33c
cleanup
abi87 3fea872
cleanup
abi87 2894f7c
nit
abi87 0758ec0
Some more cleanup
abi87 1fc7105
simplified AVM backend interface
abi87 86f2558
Merge branch 'master' into x-chain_repack_tx_builder
abi87 808d680
Merge branch 'x-chain_repack_tx_builder' into x-chain-consolidate-tx-…
abi87 4dd1890
Merge branch 'master' into x-chain_repack_tx_builder
abi87 0073de6
Merge branch 'x-chain_repack_tx_builder' into x-chain-consolidate-tx-…
abi87 a37652c
Merge branch 'master' into x-chain_repack_tx_builder
abi87 d80d282
Merge branch 'x-chain_repack_tx_builder' into x-chain-consolidate-tx-…
abi87 796e31a
Merge branch 'master' into x-chain_repack_tx_builder
abi87 0134d7d
Merge branch 'master' into x-chain_repack_tx_builder
abi87 ecfbd6a
nit
abi87 37440f4
Merge branch 'master' into x-chain_repack_tx_builder
abi87 35dd485
Merge branch 'x-chain_repack_tx_builder' into x-chain-consolidate-tx-…
abi87 c46c132
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 ba8f805
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 71c0202
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 06628d6
wip: reverted prod code changes
abi87 adb9c2d
wip: move UTs to use their own backend
abi87 f7af3c1
consolidated txBuilder to make them similar to P-chain
abi87 10db896
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 bee94af
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 21550da
simplified avm test environment
abi87 2020d1c
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 9d4e0d4
consolidated avm UTs cleanup
abi87 9b31b05
nits over avm tx builder
abi87 3013fb1
removed some code duplication across UTs
abi87 003fa79
cleanup
abi87 8880e77
nit
abi87 b6d1869
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 350725e
nit
abi87 768cbf5
Merge branch 'x-chain-consolidate-tx-creation' of github.com:ava-labs…
abi87 f73ea9d
nits
abi87 de87fd6
some more nits
abi87 c0f0a3a
reduced diff
abi87 760fbf8
nit
abi87 870361a
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 8b4779d
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 3b65160
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 29f7af7
fixed UTs locking
abi87 fc07c85
nit
abi87 966e472
reduced diffs
abi87 becfdbd
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 1d17690
nit
abi87 1e8def5
Merge branch 'master' into x-chain-consolidate-tx-creation
abi87 aab2739
refactored placeholder_signature
abi87 c5ea3e1
nit
abi87 cbe35fa
some more cleanup
abi87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,14 +24,14 @@ import ( | |
"github.com/ava-labs/avalanchego/utils/crypto/secp256k1" | ||
"github.com/ava-labs/avalanchego/utils/formatting" | ||
"github.com/ava-labs/avalanchego/utils/formatting/address" | ||
"github.com/ava-labs/avalanchego/utils/linked" | ||
"github.com/ava-labs/avalanchego/utils/logging" | ||
"github.com/ava-labs/avalanchego/utils/sampler" | ||
"github.com/ava-labs/avalanchego/utils/timer/mockable" | ||
"github.com/ava-labs/avalanchego/vms/avm/block/executor" | ||
"github.com/ava-labs/avalanchego/vms/avm/config" | ||
"github.com/ava-labs/avalanchego/vms/avm/fxs" | ||
"github.com/ava-labs/avalanchego/vms/avm/txs" | ||
"github.com/ava-labs/avalanchego/vms/avm/txs/txstest" | ||
"github.com/ava-labs/avalanchego/vms/components/avax" | ||
"github.com/ava-labs/avalanchego/vms/nftfx" | ||
"github.com/ava-labs/avalanchego/vms/secp256k1fx" | ||
|
@@ -77,12 +77,6 @@ var ( | |
|
||
keys = secp256k1.TestKeys()[:3] // TODO: Remove [:3] | ||
addrs []ids.ShortID // addrs[i] corresponds to keys[i] | ||
|
||
noFeesTestConfig = &config.Config{ | ||
EUpgradeTime: mockable.MaxTime, | ||
TxFee: 0, | ||
CreateAssetTxFee: 0, | ||
} | ||
) | ||
|
||
func init() { | ||
|
@@ -110,13 +104,12 @@ type envConfig struct { | |
} | ||
|
||
type environment struct { | ||
genesisBytes []byte | ||
genesisTx *txs.Tx | ||
sharedMemory *atomic.Memory | ||
issuer chan common.Message | ||
vm *VM | ||
service *Service | ||
walletService *WalletService | ||
Comment on lines
-118
to
-119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dropped service and walletService. Using txBuilder to create txs instead. |
||
genesisBytes []byte | ||
genesisTx *txs.Tx | ||
sharedMemory *atomic.Memory | ||
issuer chan common.Message | ||
vm *VM | ||
txBuilder *txstest.Builder | ||
} | ||
|
||
// setup the testing environment | ||
|
@@ -204,19 +197,14 @@ func setup(tb testing.TB, c *envConfig) *environment { | |
stopVertexID := ids.GenerateTestID() | ||
issuer := make(chan common.Message, 1) | ||
|
||
backend := txstest.NewBackend(vm.ctx, vm.state, vm.ctx.SharedMemory, vm.parser.Codec()) | ||
env := &environment{ | ||
genesisBytes: genesisBytes, | ||
genesisTx: getCreateTxFromGenesisTest(tb, genesisBytes, assetName), | ||
sharedMemory: m, | ||
issuer: issuer, | ||
vm: vm, | ||
service: &Service{ | ||
vm: vm, | ||
}, | ||
walletService: &WalletService{ | ||
vm: vm, | ||
pendingTxs: linked.NewHashmap[ids.ID, *txs.Tx](), | ||
}, | ||
txBuilder: txstest.New(vm.ctx, &vm.Config, vm.feeAssetID, backend), | ||
} | ||
|
||
require.NoError(vm.SetState(context.Background(), snow.Bootstrapping)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one of the key point of this PR: no more zero fees config. With the E upgrade we won't have zero fees anymore