Skip to content

Commit

Permalink
Merge pull request #3 from Dharitri-org/raj
Browse files Browse the repository at this point in the history
v0.0.2
  • Loading branch information
bhagyaraj1208117 committed Mar 26, 2024
2 parents ddcbea0 + fdee708 commit f97cee2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/Dharitri-org/drtg-bigint v0.0.0
github.com/Dharitri-org/drtg-vm-common v0.0.2
github.com/Dharitri-org/drtg-vm-common v0.0.3
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/Dharitri-org/drtg-bigint v0.0.0 h1:EcrkQcYxLg+RCQre5ezwQu79ylS5HUFb7+WN4dDajBE=
github.com/Dharitri-org/drtg-bigint v0.0.0/go.mod h1:ylHJu49RWsuap7jF/t+adMT7thADEIqoKa6wUaG+BWA=
github.com/Dharitri-org/drtg-vm-common v0.0.2 h1:5sN4/YKDkcZl+2RTK2tIxJUxXnOq6Cgw/lwG+2i8XAk=
github.com/Dharitri-org/drtg-vm-common v0.0.2/go.mod h1:tDiSMwcuHkyTfIk3w4rqi7NdB8PeuQrPknPd3fgdimg=
github.com/Dharitri-org/drtg-vm-common v0.0.3 h1:MGIJ2N4GbQrSBBskUQ8uBTpL9oGNhzZlyFbzfQ8Fmmc=
github.com/Dharitri-org/drtg-vm-common v0.0.3/go.mod h1:tDiSMwcuHkyTfIk3w4rqi7NdB8PeuQrPknPd3fgdimg=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
16 changes: 15 additions & 1 deletion mock-hook-blockchain/worldCallbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var _ vmcommon.BlockchainHook = (*BlockchainHookMock)(nil)

var zero = big.NewInt(0)

// NewAddress adapts between K model and dharitri function
// NewAddress adapts between K model and elrond function
func (b *BlockchainHookMock) NewAddress(creatorAddress []byte, creatorNonce uint64, _ []byte) ([]byte, error) {
// explicit new address mocks
for _, newAddressMock := range b.NewAddressMocks {
Expand Down Expand Up @@ -183,3 +183,17 @@ func (b *BlockchainHookMock) IsSmartContract(address []byte) bool {

return account.IsSmartContract
}

func (b *BlockchainHookMock) IsPayable(address []byte) (bool, error) {
account := b.AcctMap.GetAccount(address)
if account == nil {
return true, nil
}

if !account.IsSmartContract {
return true, nil
}

metadata := vmcommon.CodeMetadataFromBytes(account.CodeMetadata)
return metadata.Payable, nil
}
2 changes: 1 addition & 1 deletion test-util/denali/controller/scenarioDir.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (r *ScenarioRunner) RunAllJSONScenariosInDirectory(
fmt.Print(" ok\n")
} else {
nrFailed++
fmt.Print(" FAIL!!!\n")
fmt.Printf(" FAIL: %s\n", testErr.Error())
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test-util/denali/json/model/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const (
// ScCall describes a regular smart contract call
ScCall

// Transfer is an ERD transfer transaction without calling a smart contract
// Transfer is an MOA transfer transaction without calling a smart contract
Transfer

// ValidatorReward is when the protocol sends a validator reward to the target account.
Expand Down

0 comments on commit f97cee2

Please sign in to comment.