Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
SupunS committed Jan 25, 2024
1 parent 956e306 commit f1971b5
Show file tree
Hide file tree
Showing 17 changed files with 1,034 additions and 225 deletions.
2 changes: 1 addition & 1 deletion adapters/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ func (b *SDKAdapter) CreateAccount(ctx context.Context, publicKeys []*sdk.Accoun
return sdk.Address{}, err
}

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetReferenceBlockID(sdk.Identifier(latestBlock.ID())).
SetProposalKey(serviceKey.Address, serviceKey.Index, serviceKey.SequenceNumber).
SetPayer(serviceKey.Address)
Expand Down
46 changes: 23 additions & 23 deletions emulator/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestGetAccount(t *testing.T) {

tx := templates.AddAccountContract(b.ServiceKey().Address, contract)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -191,7 +191,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -233,7 +233,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -274,7 +274,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -323,7 +323,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -395,7 +395,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -446,7 +446,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -497,7 +497,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -549,7 +549,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -585,7 +585,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -621,7 +621,7 @@ func TestCreateAccount(t *testing.T) {
)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -655,7 +655,7 @@ func TestAddAccountKey(t *testing.T) {
tx1, err := templates.AddAccountKey(b.ServiceKey().Address, newAccountKey)
assert.NoError(t, err)

tx1.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx1.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand All @@ -682,7 +682,7 @@ func TestAddAccountKey(t *testing.T) {

tx2 := flowsdk.NewTransaction().
SetScript(script).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, newKeyID, newKeySequenceNum).
SetPayer(b.ServiceKey().Address)

Expand All @@ -709,7 +709,7 @@ func TestAddAccountKey(t *testing.T) {
tx, err := templates.AddAccountKey(b.ServiceKey().Address, accountKey)
assert.NoError(t, err)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -743,7 +743,7 @@ func TestRemoveAccountKey(t *testing.T) {
assert.NoError(t, err)

// create transaction that adds public key to account keys
tx1.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx1.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -775,7 +775,7 @@ func TestRemoveAccountKey(t *testing.T) {
// create transaction that removes service key
tx2 := templates.RemoveAccountKey(b.ServiceKey().Address, 0)

tx2.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx2.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -807,7 +807,7 @@ func TestRemoveAccountKey(t *testing.T) {
// create transaction that removes remaining account key
tx3 := templates.RemoveAccountKey(b.ServiceKey().Address, 0)

tx3.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx3.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -842,7 +842,7 @@ func TestRemoveAccountKey(t *testing.T) {
// create transaction that removes remaining account key
tx4 := templates.RemoveAccountKey(b.ServiceKey().Address, 1)

tx4.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx4.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, account.Keys[1].Index, account.Keys[1].SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -929,7 +929,7 @@ func TestUpdateAccountCode(t *testing.T) {
},
)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -988,7 +988,7 @@ func TestUpdateAccountCode(t *testing.T) {
},
)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -1055,7 +1055,7 @@ func TestImportAccountCode(t *testing.T) {

tx := flowsdk.NewTransaction().
SetScript(script).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -1131,7 +1131,7 @@ func TestAccountAccess(t *testing.T) {
},
)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down Expand Up @@ -1187,7 +1187,7 @@ func TestAccountAccess(t *testing.T) {
},
)

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down
2 changes: 1 addition & 1 deletion emulator/block_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestBlockInfo(t *testing.T) {
}
}
`)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down
6 changes: 3 additions & 3 deletions emulator/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestCommitBlock(t *testing.T) {

tx1 := flowsdk.NewTransaction().
SetScript([]byte(addTwoScript)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand All @@ -71,7 +71,7 @@ func TestCommitBlock(t *testing.T) {

tx2 := flowsdk.NewTransaction().
SetScript([]byte(`transaction { execute { panic("revert!") } }`)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestBlockView(t *testing.T) {

tx := flowsdk.NewTransaction().
SetScript([]byte(addTwoScript)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand Down
6 changes: 3 additions & 3 deletions emulator/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ import (
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/interpreter"
"github.com/onflow/crypto"
"github.com/onflow/crypto/hash"
"github.com/onflow/flow-core-contracts/lib/go/templates"
flowsdk "github.com/onflow/flow-go-sdk"
sdkcrypto "github.com/onflow/flow-go-sdk/crypto"
"github.com/onflow/flow-go/access"
"github.com/onflow/flow-go/crypto"
"github.com/onflow/flow-go/crypto/hash"
"github.com/onflow/flow-go/engine"
"github.com/onflow/flow-go/fvm"
fvmcrypto "github.com/onflow/flow-go/fvm/crypto"
Expand Down Expand Up @@ -1737,7 +1737,7 @@ func (b *Blockchain) systemChunkTransaction() (*flowgo.TransactionBody, error) {

tx := flowgo.NewTransactionBody().
SetScript([]byte(script)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
AddAuthorizer(b.GetChain().ServiceAddress()).
SetPayer(b.GetChain().ServiceAddress()).
SetReferenceBlockID(b.pendingBlock.parentID)
Expand Down
4 changes: 2 additions & 2 deletions emulator/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestCollections(t *testing.T) {

tx1 := flowsdk.NewTransaction().
SetScript([]byte(addTwoScript)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand All @@ -79,7 +79,7 @@ func TestCollections(t *testing.T) {

tx2 := flowsdk.NewTransaction().
SetScript([]byte(addTwoScript)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand Down
4 changes: 2 additions & 2 deletions emulator/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewCommonContracts(chain flowgo.Chain) []ContractDescription {
Name: "ExampleNFT",
Address: serviceAddress,
Description: "✨ Example NFT contract",
Source: contracts.ExampleNFT(serviceAddress, serviceAddress, serviceAddress, serviceAddress),
Source: contracts.ExampleNFT(serviceAddress, serviceAddress, serviceAddress),
},
// TODO:
//{
Expand Down Expand Up @@ -98,7 +98,7 @@ func deployContract(b *Blockchain, name string, contract []byte) error {
Source: string(contract),
})

tx.SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
tx.SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetReferenceBlockID(flowsdk.Identifier(latestBlock.ID())).
SetProposalKey(serviceAddress, serviceKey.Index, serviceKey.SequenceNumber).
SetPayer(serviceAddress)
Expand Down
2 changes: 1 addition & 1 deletion emulator/coverage_report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestCoverageReport(t *testing.T) {

tx := flowsdk.NewTransaction().
SetScript([]byte(addTwoScript)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand Down
2 changes: 1 addition & 1 deletion emulator/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestEventEmitted(t *testing.T) {

tx := flowsdk.NewTransaction().
SetScript(script).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address)

Expand Down
2 changes: 1 addition & 1 deletion emulator/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func TestInitialization(t *testing.T) {

tx := flowsdk.NewTransaction().
SetScript([]byte(script)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand Down
10 changes: 5 additions & 5 deletions emulator/pendingBlock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func setupPendingBlockTests(t *testing.T) (

tx1 := flowsdk.NewTransaction().
SetScript([]byte(addTwoScript)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand All @@ -65,7 +65,7 @@ func setupPendingBlockTests(t *testing.T) (

tx2 := flowsdk.NewTransaction().
SetScript([]byte(addTwoScript)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber+1).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand All @@ -77,7 +77,7 @@ func setupPendingBlockTests(t *testing.T) (

invalid := flowsdk.NewTransaction().
SetScript([]byte(`transaction { execute { panic("revert!") } }`)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand Down Expand Up @@ -342,7 +342,7 @@ func TestPendingBlockCommit(t *testing.T) {
t.Run("CommitBlock", func(t *testing.T) {
tx1 := flowsdk.NewTransaction().
SetScript([]byte(addTwoScript)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand Down Expand Up @@ -374,7 +374,7 @@ func TestPendingBlockCommit(t *testing.T) {
t.Run("ExecuteAndCommitBlock", func(t *testing.T) {
tx1 := flowsdk.NewTransaction().
SetScript([]byte(addTwoScript)).
SetGasLimit(flowgo.DefaultMaxTransactionGasLimit).
SetComputeLimit(flowgo.DefaultMaxTransactionGasLimit).
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
SetPayer(b.ServiceKey().Address).
AddAuthorizer(b.ServiceKey().Address)
Expand Down
Loading

0 comments on commit f1971b5

Please sign in to comment.