Skip to content
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

Log events fixes #778

Merged
merged 16 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mock/context/outputContextMock.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ func (o *OutputContextMock) DeleteFirstReturnData() {
// WriteLog mocked method
func (o *OutputContextMock) WriteLog(_ []byte, _ [][]byte, _ [][]byte) {}

// WriteLogWithIdentifier mocked method
func (o *OutputContextMock) WriteLogWithIdentifier(_ []byte, _ [][]byte, _ [][]byte, _ []byte) {
}

// TransferValueOnly mocked method
func (o *OutputContextMock) TransferValueOnly(_ []byte, _ []byte, _ *big.Int, _ bool) error {
return o.TransferResult
Expand All @@ -177,7 +181,7 @@ func (o *OutputContextMock) Transfer(_ []byte, _ []byte, _ uint64, _ uint64, _ *
}

// TransferESDT mocked method
func (o *OutputContextMock) TransferESDT(transfersArgs *vmhost.ESDTTransfersArgs, _ *vmcommon.ContractCallInput) (uint64, error) {
func (o *OutputContextMock) TransferESDT(_ *vmhost.ESDTTransfersArgs, _ *vmcommon.ContractCallInput) (uint64, error) {
return 0, nil
}

Expand Down
8 changes: 8 additions & 0 deletions mock/context/outputContextStub.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type OutputContextStub struct {
GetOutputAccountCalled func(address []byte) (*vmcommon.OutputAccount, bool)
DeleteOutputAccountCalled func(address []byte)
WriteLogCalled func(address []byte, topics [][]byte, data [][]byte)
WriteLogWithIdentifierCalled func(address []byte, topics [][]byte, data [][]byte, identifier []byte)
TransferCalled func(destination []byte, sender []byte, gasLimit uint64, gasLocked uint64, value *big.Int, asyncData []byte, input []byte) error
TransferESDTCalled func(transfersArgs *vmhost.ESDTTransfersArgs, input *vmcommon.ContractCallInput) (uint64, error)
GetRefundCalled func() uint64
Expand Down Expand Up @@ -144,6 +145,13 @@ func (o *OutputContextStub) WriteLog(address []byte, topics [][]byte, data [][]b
}
}

// WriteLogWithIdentifier mocked method
func (o *OutputContextStub) WriteLogWithIdentifier(address []byte, topics [][]byte, data [][]byte, identifier []byte) {
if o.WriteLogWithIdentifierCalled != nil {
o.WriteLogWithIdentifierCalled(address, topics, data, identifier)
}
}

// TransferValueOnly mocked method
func (o *OutputContextStub) TransferValueOnly(destination []byte, sender []byte, value *big.Int, checkPayable bool) error {
if o.TransferValueOnlyCalled != nil {
Expand Down
3 changes: 1 addition & 2 deletions test/delegation/v0_2/purchase/purchase_buy_1x.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
],
"data": [
"str:DirectCall",
"str:purchaseStake",
"str:delegator_1___________________s1"
"str:payment for stake"
]
},
{
Expand Down
6 changes: 2 additions & 4 deletions test/delegation/v0_2/purchase/purchase_buy_2x.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
],
"data": [
"str:DirectCall",
"str:purchaseStake",
"str:delegator_1___________________s1"
"str:payment for stake"
]
},
{
Expand Down Expand Up @@ -116,8 +115,7 @@
],
"data": [
"str:DirectCall",
"str:purchaseStake",
"str:delegator_1___________________s1"
"str:payment for stake"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions test/delegation/v0_2/unstake/stake_unstake_1.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
],
"data": [
"str:DirectCall",
"str:unstake",
"567,000,000,000"
"str:delegation unstake"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
],
"data": [
"str:DirectCall",
"str:withdrawInactiveStake",
"1,000,000,000"
"str:delegation withdraw inactive stake"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,21 @@
"sc:delegation"
],
"data": [
"str:AsyncCall",
"str:unBond",
"str:bls_key_5_______________________________________________________________________________________"
"str:BackTransfer",
"0"
]
},
{
"address": "sc:auction",
"endpoint": "str:transferValueOnly",
"topics": [
"111,000,000,000,000",
"sc:delegation"
],
"data": [
"str:AsyncCallback",
"str:callBack",
"0x00"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,21 @@
"sc:delegation"
],
"data": [
"str:AsyncCall",
"str:unBond",
"str:bls_key_6_______________________________________________________________________________________",
"str:bls_key_3_______________________________________________________________________________________",
"str:bls_key_2_______________________________________________________________________________________"
"str:BackTransfer",
"0"
]
},
{
"address": "sc:auction",
"endpoint": "str:transferValueOnly",
"topics": [
"333,000,000,000,000",
"sc:delegation"
],
"data": [
"str:AsyncCallback",
"str:callBack",
"0x00"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
],
"data": [
"str:DirectCall",
"str:withdrawInactiveStake",
"1,000,000,000,000"
"str:delegation withdraw inactive stake"
]
},
{
Expand Down Expand Up @@ -105,8 +104,7 @@
],
"data": [
"str:DirectCall",
"str:withdrawInactiveStake",
"113,000,000,000,000"
"str:delegation withdraw inactive stake"
]
},
{
Expand Down Expand Up @@ -183,8 +181,7 @@
],
"data": [
"str:DirectCall",
"str:withdrawInactiveStake",
"284,000,000,000,000"
"str:delegation withdraw inactive stake"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
],
"data": [
"str:DirectCall",
"str:claimRewards"
"str:delegation rewards claim"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
],
"data": [
"str:DirectCall",
"str:claimRewards"
"str:delegation rewards claim"
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,21 @@
"sc:delegation"
],
"data": [
"str:AsyncCall",
"str:unBondNodes",
"str:bls_key_6_______________________________________________________________________________________"
"str:BackTransfer",
"0"
]
},
{
"address": "sc:auction",
"endpoint": "str:transferValueOnly",
"topics": [
"100,000,000,000,000",
"sc:delegation"
],
"data": [
"str:AsyncCallback",
"str:callBack",
"0x00"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,21 @@
"sc:delegation"
],
"data": [
"str:AsyncCall",
"str:unBondTokens",
"1000"
"str:BackTransfer",
""
]
},
{
"address": "sc:auction",
"endpoint": "str:transferValueOnly",
"topics": [
"1000",
"sc:delegation"
],
"data": [
"str:AsyncCallback",
"str:callBack",
"0x00"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion test/dns/scenarios/05_claim.steps.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
],
"data": [
"str:DirectCall",
"str:claim"
"str:dns claim"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,21 @@
"sc:forwarder"
],
"data": [
"str:AsyncCall",
"str:retrieve_funds",
"str:EGLD",
"0",
"1000"
"str:BackTransfer",
""
]
},
{
"address": "sc:vault",
"endpoint": "str:transferValueOnly",
"topics": [
"1000",
"sc:forwarder"
],
"data": [
"str:AsyncCallback",
"str:retrieve_funds_callback",
"0x00"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"sc:forwarder"
],
"data": [
"str:AsyncCall",
"str:BackTransfer",
"str:ESDTTransfer",
"str:TEST-TOKENA",
"1000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DeploySmartContract",
"str:echo_arguments",
"1",
"2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DirectCall",
"str:echo_arguments",
"1",
"2"
Expand Down Expand Up @@ -110,7 +110,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DirectCall",
"str:echo_arguments",
"1",
"2"
Expand Down Expand Up @@ -139,7 +139,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DirectCall",
"str:echo_arguments",
"1",
"2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DirectCall",
"str:echo_caller"
]
},
Expand Down Expand Up @@ -96,7 +96,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DirectCall",
"str:echo_caller"
]
},
Expand All @@ -118,7 +118,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DirectCall",
"str:echo_caller"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DirectCall",
"str:accept_funds"
]
},
Expand Down Expand Up @@ -104,7 +104,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DirectCall",
"str:accept_funds"
]
},
Expand Down Expand Up @@ -137,7 +137,7 @@
"sc:vault"
],
"data": [
"str:ExecuteOnDestContext",
"str:DirectCall",
"str:accept_funds"
]
},
Expand Down
Loading
Loading