forked from fibercrypto/libfibercrypto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cgo] refs fibercrypto#5 Added
coin.mocks.WalletEnv
- Loading branch information
Maykel Arias Torres
committed
Mar 24, 2020
1 parent
3e60cb6
commit dbef753
Showing
4 changed files
with
72 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package main | ||
|
||
/* | ||
#include <string.h> | ||
#include <stdlib.h> | ||
#include "fctypes.h" | ||
*/ | ||
import "C" | ||
|
||
//export FC_mocks_WalletEnv_GetStorage | ||
func FC_mocks_WalletEnv_GetStorage(__m *C.WalletEnvMocks__Handle, _arg0 *C.WalletStorage__Handle) (____error_code uint32) { | ||
_m, ok_m := lookupWalletEnvMocksHandle(*__m) | ||
if !ok_m { | ||
____error_code = FC_BAD_HANDLE | ||
return | ||
} | ||
__arg0 := _m.GetStorage() | ||
*_arg0 = registerWalletStorageHandle(&__arg0) | ||
return | ||
} | ||
|
||
//export FC_mocks_WalletEnv_GetWalletSet | ||
func FC_mocks_WalletEnv_GetWalletSet(__m *C.WalletEnvMocks__Handle, _arg0 *C.WalletSet__Handle) (____error_code uint32) { | ||
_m, ok_m := lookupWalletEnvMocksHandle(*__m) | ||
if !ok_m { | ||
____error_code = FC_BAD_HANDLE | ||
return | ||
} | ||
__arg0 := _m.GetWalletSet() | ||
*_arg0 = registerWalletSetHandle(&__arg0) | ||
return | ||
} | ||
|
||
//export FC_mocks_WalletEnv_LookupWallet | ||
func FC_mocks_WalletEnv_LookupWallet(__m *C.WalletEnvMocks__Handle, _firstAddr string, _arg1 *C.Wallet__Handle) (____error_code uint32) { | ||
_m, ok_m := lookupWalletEnvMocksHandle(*__m) | ||
if !ok_m { | ||
____error_code = FC_BAD_HANDLE | ||
return | ||
} | ||
firstAddr := _firstAddr | ||
__arg1, ____return_err := _m.LookupWallet(firstAddr) | ||
____error_code = libErrorCode(____return_err) | ||
if ____return_err == nil { | ||
*_arg1 = registerWalletHandle(&__arg1) | ||
} | ||
return | ||
} |
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
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