Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kpachhai committed Oct 16, 2024
1 parent b9c072a commit c7c99bd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nuklaivm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
- name: Run unit tests
shell: bash
run: scripts/tests.unit.sh
# - name: Run integration tests
# shell: bash
# run: scripts/tests.integration.sh
- name: Run integration tests
shell: bash
run: scripts/tests.integration.sh

# nuklaivm-e2e-tests:
# needs: [nuklaivm-lint, nuklaivm-unit-tests]
Expand Down
1 change: 1 addition & 0 deletions actions/claim_marketplace_payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (*ClaimMarketplacePayment) GetTypeID() uint8 {
func (c *ClaimMarketplacePayment) StateKeys(actor codec.Address) state.Keys {
return state.Keys{
string(storage.AssetInfoKey(c.MarketplaceAssetAddress)): state.Read | state.Write,
string(storage.AssetInfoKey(c.PaymentAssetAddress)): state.Read | state.Write,
string(storage.AssetAccountBalanceKey(c.PaymentAssetAddress, actor)): state.All,
}
}
Expand Down
1 change: 1 addition & 0 deletions actions/claim_marketplace_payment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func TestClaimMarketplacePaymentAction(t *testing.T) {
metadataBytes, err := utils.MapToBytes(metadata)
require.NoError(t, err)
require.NoError(t, storage.SetAssetInfo(context.Background(), store, marketplaceAssetAddress, nconsts.AssetMarketplaceTokenID, []byte("name"), []byte("SYM"), 0, metadataBytes, []byte(marketplaceAssetAddress.String()), 0, 0, actor, codec.EmptyAddress, codec.EmptyAddress, codec.EmptyAddress, codec.EmptyAddress))
require.NoError(t, storage.SetAssetInfo(context.Background(), store, baseAssetAddress, nconsts.AssetFungibleTokenID, []byte("name"), []byte("SYM"), 0, metadataBytes, []byte(baseAssetAddress.String()), 0, 0, codec.EmptyAddress, codec.EmptyAddress, codec.EmptyAddress, codec.EmptyAddress, codec.EmptyAddress))
return store
}(),
Assertion: func(ctx context.Context, t *testing.T, store state.Mutable) {
Expand Down
3 changes: 2 additions & 1 deletion actions/subscribe_dataset_marketplace.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ func (d *SubscribeDatasetMarketplace) StateKeys(actor codec.Address) state.Keys
nftAddress := storage.AssetAddressNFT(d.MarketplaceAssetAddress, nil, actor)
return state.Keys{
string(storage.AssetInfoKey(d.MarketplaceAssetAddress)): state.Read | state.Write,
string(storage.AssetInfoKey(d.PaymentAssetAddress)): state.Read | state.Write,
string(storage.AssetInfoKey(nftAddress)): state.All,
string(storage.AssetAccountBalanceKey(d.MarketplaceAssetAddress, actor)): state.Allocate | state.Write,
string(storage.AssetAccountBalanceKey(d.PaymentAssetAddress, actor)): state.Read | state.Write,
string(storage.AssetAccountBalanceKey(nftAddress, actor)): state.All,
string(storage.AssetInfoKey(d.PaymentAssetAddress)): state.Read | state.Write,
}
}

Expand Down

0 comments on commit c7c99bd

Please sign in to comment.